/**
 * @author yinyunqi
 * @datetime 2018年1月7日
 * @Content 
 */
package com.yongqi.service.console;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yongqi.mapper.console.DebtMapper;
import com.yongqi.model.console.Debt;

@Service
public class DebtService {
    @Autowired
    DebtMapper debtMapper;
    
    // 借款添加记录方法
    public void insertDebt(Debt debt) {
	debtMapper.insertDebt(debt);
    }

    // 借款分页查询方法
    public List<Debt> queryPageItems(Map<String, String> map) {
	List<Debt> debtList = debtMapper.queryPageItems(map);
	return debtList;
    }

    // 借款删除记录方法
    public void deleteDebtItems(String id) {
	debtMapper.deleteItems(id);
    }

    // 借款修改记录方法
    public void updateDebt(Debt debt) {
	debtMapper.updateDebt(debt);
    }
    
    // 七天内到期借款
    public List<Debt> endDebt( Map<String, String> map) {
	List<Debt> endDebtList = debtMapper.endDebt(map);
	return endDebtList;
    }
    // 今天到期借款
    public List<Debt> todayEndDebt(Map<String, String> map) {
	List<Debt> todayEndDebtList = debtMapper.todayEndDebt(map);
	return todayEndDebtList;
    }
    // 今已经到期借款
    public List<Debt> endedDebt(Map<String, String> map) {
	List<Debt> endedDebtList = debtMapper.endedDebt(map);
	return endedDebtList;
    }
    // 超时借款
    public List<Debt> overTimeDebt(){
	List<Debt> endedDebtList = debtMapper.overTimeDebt();
	return endedDebtList;
    }
}
